<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <title>添加秒杀活动</title>
    <!-- JQuery -->
    <script type="text/javascript" src="/static/js/jquery.min.js"></script>
    <!-- Bootstrap核心CSS和JS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script>
        $(function () {
            $("#btn_submit").click(function () {
                $.getJSON(
                    "/admin/kill/doAdd",
                    $("#goods").serialize(),
                    function (json) {
                        if (json.statusCode === 200) {
                            alert("添加成功");
                            location.href = "/admin/kill";
                            //正常响应
                        } else {
                            alert(json.msg);
                        }
                    },
                    "json"
                );
            })
        });
    </script>
</head>
<body>
<div class="container">
    <h1 class="page-header">添加秒杀活动</h1>
    <form id="goods" class="form-horizontal" role="form">
        <div class="form-group">
            <label class="col-sm-2 control-label" for="goodsId">
                设置秒杀商品ID：
            </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="goodsId" name="goodsId">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="killPrice">
                设置秒杀价格：
            </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="killPrice" name="killPrice">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="stockCount">
                设置秒杀数量：
            </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="stockCount" name="stockCount">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="dateStart">
                设置开始时间：
            </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="dateStart" name="dateStart">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="dateEnd">
                设置结束时间：
            </label>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="dateEnd" name="dateEnd">
                <input type="button" class="btn btn-lg btn-danger btn-block" style="margin-top: 30px" id="btn_submit"
                       value="添加活动">
            </div>
        </div>
    </form>
</div>



</body>
</html>